package com.yikome.order.enums;

public enum OrderStatus {

	ORDER_REJECT(-20 , "拒收") , 
	
	ORDER_CANCEL(-10 , "取消") , 
	
	ORDER_PAY(-5 , "待付款"),
	
	ORDER_REVIEW(0 , "待审核"),
	
	ORDER_STOCK(10 , "备货中"),
	
	ORDER_DISTRIBUTION(20 , "配货中") ,
	
	ORDER_DELIVERY(30 , "运输中"),
	
	ORDER_RECEIVE(40 , "签收");
	
	
	private int status ; 
	private String statusName ;
	
	private OrderStatus (int status , String statusName) {
		this.status = status; 
		this.statusName = statusName;
	}

	public int getStatus() {
		return status;
	}

	public String getStatusName() {
		return statusName;
	}
	
	public static OrderStatus OrderStatusByStatus(int status) {
		OrderStatus[] orderStatues = OrderStatus.values();
		for (OrderStatus orderStatus : orderStatues) {
			if(orderStatus.getStatus() == status) {
				return orderStatus;
			}
		}
		return null;
	}
}
